package com.ruoyi.project.card.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.card.mapper.AlumniInfoMapper;
import com.ruoyi.project.card.domain.AlumniInfo;
import com.ruoyi.project.card.service.IAlumniInfoService;

/**
 * cardInfoService业务层处理
 *
 * @author hongwj
 * @date 2024-05-03
 */
@Service
public class AlumniInfoServiceImpl implements IAlumniInfoService {
    @Autowired
    private AlumniInfoMapper alumniInfoMapper;

    /**
     * 查询cardInfo
     *
     * @param id cardInfo主键
     * @return cardInfo
     */
    @Override
    public AlumniInfo selectAlumniInfoById(Long id) {
        return alumniInfoMapper.selectAlumniInfoById(id);
    }

    /**
     * 查询cardInfo列表
     *
     * @param alumniInfo cardInfo
     * @return cardInfo
     */
    @Override
    public List<AlumniInfo> selectAlumniInfoList(AlumniInfo alumniInfo) {
        return alumniInfoMapper.selectAlumniInfoList(alumniInfo);
    }

    /**
     * 新增cardInfo
     *
     * @param alumniInfo cardInfo
     * @return 结果
     */
    @Override
    public int insertAlumniInfo(AlumniInfo alumniInfo) {
        alumniInfo.setUserId(SecurityUtils.getUserId());
        alumniInfo.setStatus("0");
        alumniInfo.setCreateTime(DateUtils.getNowDate());
        return alumniInfoMapper.insertAlumniInfo(alumniInfo);
    }

    /**
     * 修改cardInfo
     *
     * @param alumniInfo cardInfo
     * @return 结果
     */
    @Override
    public int updateAlumniInfo(AlumniInfo alumniInfo) {
        alumniInfo.setUpdateTime(DateUtils.getNowDate());
        return alumniInfoMapper.updateAlumniInfo(alumniInfo);
    }

    /**
     * 批量删除cardInfo
     *
     * @param ids 需要删除的cardInfo主键
     * @return 结果
     */
    @Override
    public int deleteAlumniInfoByIds(Long[] ids) {
        return alumniInfoMapper.deleteAlumniInfoByIds(ids);
    }

    /**
     * 删除cardInfo信息
     *
     * @param id cardInfo主键
     * @return 结果
     */
    @Override
    public int deleteAlumniInfoById(Long id) {
        return alumniInfoMapper.deleteAlumniInfoById(id);
    }
}
